// 库存管理接口
import request from "@/common/request.js";
const api = {
  purchase_order: "/purchase_order/",
  staff: "/staff/",
  purchase_plan: "/purchase_plan/",
  bom: "/bom/",
};

const puOrderApi = {
  get_purchase_order(params) {
    return request({
      url: api.purchase_order,
      method: "get",
      params,
    });
  },

  get_staff(params) {
    return request({
      url: api.staff,
      method: "get",
      params,
    });
  },
  get_purchase_plan(params) {
    return request({
      url: api.purchase_plan,
      method: "get",
      params,
    });
  },

  purchase_plan_detail(id) {
    return request({
      url: api.purchase_plan + id,
      method: "get",
    });
  },

  purchase_order_detail(id) {
    return request({
      url: api.purchase_order + id,
      method: "get",
    });
  },

  get_bom(params) {
    return request({
      url: api.bom,
      method: "get",
      params,
    });
  },

  post_purchase_order(data) {
    return request({
      url: api.purchase_order,
      method: "post",
      data,
    });
  },

  patch_purchase_order(data, id) {
    return request({
      url: api.purchase_order + id + "/",
      method: "patch",
      data,
    });
  },

  delete_purchase_order(id) {
    return request({
      url: api.purchase_order + id + "/",
      method: "delete",
    });
  },
};
export default puOrderApi